package models;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author eagle_eye
 */
@Entity
@Table(name = "CERTIFICADO", catalog = "sischool2", schema = "")
@NamedQueries({
    @NamedQuery(name = "Certificado.findAll", query = "SELECT c FROM Certificado c"),
    @NamedQuery(name = "Certificado.findByIdCertificado", query = "SELECT c FROM Certificado c WHERE c.idCertificado = :idCertificado"),
    @NamedQuery(name = "Certificado.findByNombrePer", query = "SELECT c FROM Certificado c WHERE c.nombrePer = :nombrePer"),
    @NamedQuery(name = "Certificado.findByCedula", query = "SELECT c FROM Certificado c WHERE c.cedula = :cedula"),
    @NamedQuery(name = "Certificado.findByCiudad", query = "SELECT c FROM Certificado c WHERE c.ciudad = :ciudad"),
    @NamedQuery(name = "Certificado.findByPeriodo", query = "SELECT c FROM Certificado c WHERE c.periodo = :periodo"),
    @NamedQuery(name = "Certificado.findByNMaterias", query = "SELECT c FROM Certificado c WHERE c.nMaterias = :nMaterias"),
    @NamedQuery(name = "Certificado.findByTotal", query = "SELECT c FROM Certificado c WHERE c.total = :total"),
    @NamedQuery(name = "Certificado.findByGrado", query = "SELECT c FROM Certificado c WHERE c.grado = :grado")})
public class Certificado implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idCertificado", nullable = false)
    private Integer idCertificado;
    @Column(name = "nombrePer", length = 45)
    private String nombrePer;
    @Basic(optional = false)
    @Column(name = "cedula", nullable = false, length = 45)
    private String cedula;
    @Column(name = "ciudad", length = 45)
    private String ciudad;
    @Column(name = "periodo", length = 45)
    private String periodo;
    @Column(name = "nMaterias")
    private Integer nMaterias;
    @Column(name = "total")
    private Integer total;
    @Basic(optional = false)
    @Column(name = "grado", nullable = false, length = 45)
    private String grado;
    @JoinColumn(name = "documentoId", referencedColumnName = "idDocumento", nullable = false)
    @ManyToOne(optional = false)
    private Documento documentoId;

    public Certificado() {
    }

    public Certificado(Integer idCertificado) {
        this.idCertificado = idCertificado;
    }

    public Certificado(Integer idCertificado, String cedula, String grado) {
        this.idCertificado = idCertificado;
        this.cedula = cedula;
        this.grado = grado;
    }

    public Integer getIdCertificado() {
        return idCertificado;
    }

    public void setIdCertificado(Integer idCertificado) {
        this.idCertificado = idCertificado;
    }

    public String getNombrePer() {
        return nombrePer;
    }

    public void setNombrePer(String nombrePer) {
        this.nombrePer = nombrePer;
    }

    public String getCedula() {
        return cedula;
    }

    public void setCedula(String cedula) {
        this.cedula = cedula;
    }

    public String getCiudad() {
        return ciudad;
    }

    public void setCiudad(String ciudad) {
        this.ciudad = ciudad;
    }

    public String getPeriodo() {
        return periodo;
    }

    public void setPeriodo(String periodo) {
        this.periodo = periodo;
    }

    public Integer getNMaterias() {
        return nMaterias;
    }

    public void setNMaterias(Integer nMaterias) {
        this.nMaterias = nMaterias;
    }

    public Integer getTotal() {
        return total;
    }

    public void setTotal(Integer total) {
        this.total = total;
    }

    public String getGrado() {
        return grado;
    }

    public void setGrado(String grado) {
        this.grado = grado;
    }

    public Documento getDocumentoId() {
        return documentoId;
    }

    public void setDocumentoId(Documento documentoId) {
        this.documentoId = documentoId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idCertificado != null ? idCertificado.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        if (!(object instanceof Certificado)) {
            return false;
        }
        Certificado other = (Certificado) object;
        if ((this.idCertificado == null && other.idCertificado != null) || (this.idCertificado != null && !this.idCertificado.equals(other.idCertificado))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "models.Certificado[idCertificado=" + idCertificado + "]";
    }

}
